<?php

namespace App\Controller;

use App\Exception\BusinessException;
use App\Service\WxUserService;
use Hyperf\Di\Annotation\Inject;
use Psr\Http\Message\ResponseInterface;

class WxUserController extends AbstractController
{
    #[Inject(WxUserService::class)]
    protected WxUserService $userService;

    /**
     * 更新用户信息
     */
    public function updateUserInfo()
    {

    }

    public function updateFrom(): ResponseInterface
    {
        $from = $this->request->input('from');
        if (!$from) throw new BusinessException();
        $this->userService->updateFromById($from, $this->user('id'));
        return $this->response->json(['msg' => 'success !!']);
    }
}